/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: GodK
 * Date: 2024-02-26
 * Time: 17:33
 */

import java.util.Arrays;
import java.util.Scanner;

public class text {
    public text() {
    }

    public static int[] transform(int[] array) {
        for(int i = 0; i < array.length; ++i) {
            array[i] *= 2;
        }

        return array;
    }

    public static void main1(String[] args) {
        int[] array = new int[]{1, 2, 3};
        String ret = Arrays.toString(transform(array));
        System.out.println(ret);
    }

    public static int[] fun(int[] array) {
        int[] ret = new int[array.length];
        int j = 0;

        int i;
        for(i = 0; i < array.length; ++i) {
            if (array[i] % 2 != 0) {
                ret[j] = array[i];
                ++j;
            }
        }

        for(i = 0; i < array.length; ++i) {
            if (array[i] % 2 == 0) {
                ret[j] = array[i];
                ++j;
            }
        }

        return ret;
    }

    public static void main2(String[] args) {
        int[] array = new int[]{1, 2, 3, 4, 5, 6};
        String ret = Arrays.toString(fun(array));
        System.out.println(ret);
    }

    public static String add(int target, int[] nums) {
        String str1 = "[";

        for(int i = 0; i < nums.length; ++i) {
            for(int j = i + 1; j < nums.length; ++j) {
                if (nums[i] + nums[j] == target) {
                    str1 = str1 + i + "," + j;
                }
            }
        }

        str1 = str1 + "]";
        if (str1.equals("[]")) {
            String str2 = "没找到";
            return str2;
        } else {
            return str1;
        }
    }

    public static void main3(String[] args) {
        int[] nums = new int[]{2, 7, 11, 15};
        Scanner scan = new Scanner(System.in);
        String ret = add(scan.nextInt(), nums);
        System.out.println(ret);
    }

    public static int dsg(int[] arr) {
        int ret = 0;

        for(int i = 0; i < arr.length; ++i) {
            ret ^= arr[i];
        }

        return ret;
    }

    public static void main4(String[] args) {
        int[] arr1 = new int[]{2, 2, 1};
        int[] arr2 = new int[]{4, 1, 2, 1, 2};
        System.out.println(dsg(arr1));
        System.out.println(dsg(arr2));
    }

    public static int arr1(int[] arr) {
        int ret = 0;

        for(int i = 0; i < arr.length; ++i) {
            int count = 1;

            for(int j = i; j < arr.length; ++j) {
                if (arr[i] == arr[j]) {
                    ++count;
                }
            }

            if (count > arr.length / 2) {
                ret = arr[i];
                break;
            }
        }

        return ret;
    }

    public static void main5(String[] args) {
        int[] arr1 = new int[]{3, 2, 3};
        int[] arr2 = new int[]{2, 2, 1, 1, 1, 2, 2};
        System.out.println(arr1(arr1));
        System.out.println(arr1(arr2));
    }

    public static boolean str(int[] arr) {
        for(int i = 0; i < arr.length - 2; ++i) {
            for(int j = i + 1; j < arr.length - 1; ++j) {
                if (arr[i] % 2 != 1 && arr[i + 1] % 2 != 1 && arr[i + 2] % 2 != 1) {
                    return true;
                }
            }
        }

        return false;
    }

    public static void main6(String[] args) {
        int[] arr1 = new int[]{2, 6, 4, 1};
        int[] arr2 = new int[]{1, 2, 34, 3, 4, 5, 7, 23, 12};
        System.out.println(str(arr1));
        System.out.println(str(arr2));
    }
}
